<!DOCTYPE html>
<html style="height:100%">
<head>
    <title></title>
    <% include ../../layouts/import.ejs %>
</head>
<body style="height:100%">
<% include ../../layouts/header.ejs %>
<div class="height index">
    <div class="container main-content">
        <div class="row">
            <form id="mainForm" role="form" method="post" action="/project/save">
                <input type="hidden" value="<%= project.id %>" name="id"/>
                <div class="form-group">
                    <label class="control-label">项目名称<span style="color:red;font-weight:bolder">*</span></label>
                    <input type="text" value="<%= project.projectName %>" id="projectName" name="projectName"
                           class="form-control"
                           data-provide="typeahead" autocomplete="false"/>
                </div>
                <div class="form-group">
                    <label class="control-label">项目代码<span style="color:red;font-weight:bolder">*</span></label>
                    <input type="text" value="<%= project.projectCode %>" id="projectCode" name="projectCode"
                           class="form-control"/>
                </div>
                <div class="form-group">
                    <label class="control-label">项目svn地址<span style="color:red;font-weight:bolder">*</span></label>
                    <input type="text" value="<%= project.projectSvnAddress %>" id="projectSvnAddress"
                           name="projectSvnAddress"
                           class="form-control"/>
                </div>
                <div class="form-group">
                    <label class="control-label">负责人<span style="color:red;font-weight:bolder">*</span></label>
                    <select id="projectLeaderId" name="projectLeaderId" class="form-control">
                        <% for(var i = 0; i < userList.length; i++) { %>
                        <option value="<%= userList[i].id %>" <%= userList[i].id===project.projectLeaderId?'selected':'' %> ><%= userList[i].person_name %></option>
                        <% } %>
                    </select>
                </div>
                <div class="form-group">
                    <label class="control-label">项目成员<span style="color:red;font-weight:bolder">*</span></label>
                    <div>
                        <% for(var i = 0; i < userList.length; i++) { %>
                        <label class="checkbox-inline"><input type="checkbox" value="<%= userList[i].id %>"
                                                              id="projectMember"
                                                              name="projectMember" <%= project.projectMemberIdStr.split(',').contains(userList[i].id)?'checked':'' %> /><%= userList[i].person_name %>
                        </label>
                        <% } %>
                    </div>

                </div>
                <div class="form-button">
                    <button type="submit" class="person-preservation btn btn-primary">保存</button>
                    <button type="button" data-dismiss="modal" id="return" class="btn btn-default" style="margin-left: 3%">返回</button>
                </div>

            </form>
        </div>
    </div>

</div>


</body>
<script>
    $('#return').click(function () {
        location.href = '/project/listAll';
    });
</script>
</html>